<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp" %>
<!-- <iframe style=" display: none;width:100%; height:100%;position:absolute; left:0;top:0;z-index:-88888;background: transparent;filter:alpha(opacity=0);  
      -moz-opacity:0;  
      -khtml-opacity:0;  
      opacity:0; " id="DevWinFrame" name="submitFramexs" class="submitFramexs" frameborder="no"> </iframe> -->
<div id="SaveOrUpdateDevWin"
	style="width: 1000px; height: 300px; padding: 10px;overflow-y: auto;"
	class="easyui-dialog" title="查询录入操作"
	data-options="modal:true,closed:true,minimizable:false,collapsible:false,maximizable:false,iconCls:'icon-save',onClose:function(){$('#saveOrUpdateDevForm')[0].reset();} ">
	<form id="saveOrUpdateDevForm" method="post" enctype="multipart/form-data" >
		<div class="menu_form_body">
			<table name="hphm" border="0" cellpadding="0" cellspacing="0" width="100%" class="cheliangxinxi">
			 <thead>
				 <tr>
				     <th align="center" height="26" >流水号</th>
					 <th align="center" height="26" >号牌号码</th>
					 <th align="center" height="26" >号牌种类</th>
					 <th align="center" height="26">车辆品牌</th>
					 <th align="center" height="26">所有人</th>
					 <th align="center" height="26">车辆识别代号</th>
					 <th align="center" height="26">业务类型</th>
					 <th align="center" height="26">办结日期</th>
					 <th align="center" height="26">操作</th>
				 </tr>
			 </thead>
			<tbody id="vehicleList"></tbody>			 
			</table>
			<div class="shenqinganniudss" id="dd" style="display:none;">
				<a href="javascript:addTabFunc();" class="sousuocx"  style="padding: 1px 10px; margin: 0 4px 0 0;">进入编辑</a>
			</div>
		</div>
	</form>
	<iframe id="iframe1" src="about:blank" frameBorder="0" marginHeight="0" marginWidth="0" style="position:absolute; visibility:inherit; top:0px;left:0px;width:1000px; height:300px;z-index:-1; filter:alpha(opacity=0);"></iframe>
</div>
<script type="text/javascript">

function applyForAuth(_data){
	$('#SaveOrUpdateDevWin').window('open');
	$("#vehicleList").html("");
	var tBodyStr="";
	$.each(_data,function(i,n){
		tBodyStr +="<tr>";
		tBodyStr +="<td align=\"center\" height=\"26\"><span class=\"indexstylelist\">"+n.lsh+"</span></td>";
		tBodyStr +="<td align=\"center\" height=\"26\"><span class=\"indexstylelist\">"+n.hphmmc+"</span></td>";
		tBodyStr +="<td align=\"center\" height=\"26\"><span class=\"indexstylelist\">"+n.hpzlmc+"</span></td>";
		tBodyStr +="<td align=\"center\" height=\"26\"><span class=\"indexstylelist\">"+n.clpp1+"</span></td>";
		tBodyStr +="<td align=\"center\" height=\"26\"><span class=\"indexstylelist\">"+n.syr+"</span></td>";
		tBodyStr +="<td align=\"center\" height=\"26\"><span class=\"indexstylelist\">"+n.clsbdh+"</span></td>";
		tBodyStr +="<td align=\"center\" height=\"26\"><span class=\"indexstylelist\">"+n.ywmc+"</span></td>";
		tBodyStr +="<td align=\"center\" height=\"26\"><span class=\"indexstylelist\">"+n.bjrq+"</span></td>";
		tBodyStr +="<td style=\"display:none\">"+n.xh+"</td>";
		tBodyStr +="<td style=\"display:none\">"+n.ywlx+"</td>";
		tBodyStr +="<td style=\"display:none\">"+n.ywyy+"</td>";
		tBodyStr +="<td style=\"display:none\">"+n.hphm+"</td>";
		tBodyStr +="<td style=\"display:none\">"+n.hpzl+"</td>";
		tBodyStr +="<td style=\"display:none\">"+n.glbm+"</td>";
		tBodyStr +="<td style=\"display:none\">"+n.xzqh+"</td>";
		tBodyStr +="<td style=\"display:none\">"+n.dabh+"</td>";
		tBodyStr +="<td align=\"center\" height=\"26\"><span class=\"indexstylelist\" id=\"insertVeh\" onclick=\"insertFunc(this);\"><a href=\"#\" style=\"color:red\">录入</a></span></td>";
		tBodyStr +="</tr>";		
	})
	$("#vehicleList").append(tBodyStr);

}

//获取当前行所有的值
function insertFunc(_this){
	var v_lsh="";
	var obj=$(_this).parent().parent();
	obj.each(function(){
		var tdVal = $(this).children();
		 v_lsh=$.trim(tdVal.eq(0).text());
		 v_xh=$.trim(tdVal.eq(8).text());
	});	 
	$.ajax({
          type:'post',
          url:'${ctx}/yxxx/queryVehcileIsNot.htm',
          data:{
              lsh:v_lsh,
              xh:v_xh
          },
          dataType:'json',
          success:function(data){
        	if(data=="true" || data==true){
        		alert("当前记录已录入档案！");
        	    return ;
        	}
        	obj.each(function(){
        		   var tdVal = $(this).children();
        		   var _ywlx = $.trim(tdVal.eq(9).text());
        		   $('#lshFlag').val($.trim(tdVal.eq(0).text()));
        		   $('#xhFlag').val($.trim(tdVal.eq(8).text()));
        		   $('#hphmFlag').val($.trim(tdVal.eq(11).text()));
        		   $('#hpzlFlag').val($.trim(tdVal.eq(12).text()));		            	   
        		   $('#clpp1Flag').val($.trim(tdVal.eq(3).text()));
        		   $('#clsbdhFlag').val($.trim(tdVal.eq(5).text()));
        		   $('#fdjhFlag').val('');
        		   $('#csysFlag').val('');
        		   $('#syrFlag').val($.trim(tdVal.eq(4).text()));
        		   $('#fzjgFlag').val('');                
        		   $('#glbmFlag').val($.trim(tdVal.eq(13).text()));
        		   $('#xzqhFlag').val($.trim(tdVal.eq(14).text()));
        		   $('#ywlxFlag').val($.trim(tdVal.eq(9).text()));
        		   $('#ywyyFlag').val($.trim(tdVal.eq(10).text()));
        		   $('#bjrqFlag').val($.trim(tdVal.eq(7).text()));
        		   $('#dabhFlag').val($.trim(tdVal.eq(15).text()));
        		   $('#ywmcFlag').val($.trim(tdVal.eq(6).text()));
        		   
        		    $('#lsh').text(tdVal.eq(0).text());
        			$('#hphmmc').text(tdVal.eq(1).text());
        			$('#hpzlmc').text(tdVal.eq(2).text());
        			$('#clpp1').text(tdVal.eq(3).text());
        			$('#syr').text(tdVal.eq(4).text());
        			$('#clsbdh').text(tdVal.eq(5).text());
        			$('#ywmc').text(tdVal.eq(6).text());
        			
        			$('#SaveOrUpdateDevWin').window('close');
        			//显示当前业务档案类型
        			if(_ywlx=='A'){
        				$('#PcPoPmarket').show();
        				$("#lmt div[class='middle']").each(function (){
            				this.style.display="none";
            			});
        				$('#AAA').show();
        			}else if(_ywlx=='B'){
        				$('#PcPoPmarket').show();
        				$("#lmt div[class='middle']").each(function (){
            				this.style.display="none";
            			});
        				$('#BBB').show();
        			}else if(_ywlx=='D' || _ywlx=='K' || _ywlx=='L'){
        				$('#PcPoPmarket').show();
        				$("#lmt div[class='middle']").each(function (){
            				this.style.display="none";
            			});
        				$('#DDD').show();
        			}else if(_ywlx=='E'){
        				$('#PcPoPmarket').show();
        				$("#lmt div[class='middle']").each(function (){
            				this.style.display="none";
            			});
        				$('#EEE').show();
        			}else if(_ywlx=='G'){
        				$('#PcPoPmarket').show();
        				$("#lmt div[class='middle']").each(function (){
            				this.style.display="none";
            			});
        				$('#GGG').show();
        			}else if(_ywlx=='I'){
        				$('#PcPoPmarket').show();
        				$("#lmt div[class='middle']").each(function (){
            				this.style.display="none";
            			});
        				$('#III').show();
        			}else if(_ywlx=='S'){
        				$('#PcPoPmarket').show();
        				$("#lmt div[class='middle']").each(function (){
            				this.style.display="none";
            			});
        				$('#SSS').show();
        			}
        			
        	});	 
          }
	})
	
 
}


</script>